Repository navigation
Port for Tricore tc1.6.2 - #841
s3neubauer wants to merge 4 commits into
Conversation
The port adds ThreadX support for the Infineon AURIX TC3xx family. It keeps thread contexts in CSA chains. Threads enter the scheduler through a system call, and interrupt handlers request the switch through a GPSR software interrupt at the lowest priority. It relies on the Infineon iLLD 1.22.0, which is not included; AURIX_ILLD_DIR names it at build time. The example runs the ThreadX demo on CPU0 of the TC375 Lite Kit.
…ample The port uses the intrinsics of the AURIX GCC and its own register definitions. The example uses the start-up code of the AURIX GCC with its own linker script and trap table.
The test runs the regression suite on the TC375 Lite Kit as one image and reports over the UART. It builds on the example of the port.
The regression BSP now contains its own tx_initialize_low_level.c, and testcontrol.c takes the size and placement of its test memories from TEST_CONTROL_MEMORY_SIZE, TESTS_MEMORY_SIZE and TEST_MEMORY_PLACEMENT, whose defaults leave other builds unchanged. The README of the test names the AURIX GCC version the tests ran with and its download link. The example and the regression test build without warnings with AURIX GCC 03_2026 on Linux and Windows.
|
Hi @s3neubauer. Thank you for this important contribution. I am on the road this week, but I will try to review it. Worst case, you will hear from me early next week. I authorised the CI run, so please keep your eyes on the result. |
There was a problem hiding this comment.
Hi @s3neubauer.
Overall, a strong first contribution. Thanks again.
All 13 TriCore regression configurations built and linked without warnings with AURIX GCC 03_2026. The GCC 14 Linux regression run passed 123/123 tests. I did not run the TriCore images on hardware.
Please address the idle low-power path and the unoptimized Release settings in the inline comments. Measured line and branch coverage for the new port code is also missing. The supplied AURIX GCC has no-op __gcov_init and __gcov_dump routines and no __gcov_exit; a --coverage regression build fails to link. Please provide coverage results using another target collection method, and identify any uncovered paths with their justification.
| break; | ||
| } | ||
| #ifdef TX_LOW_POWER | ||
| tx_low_power_enter(); |
There was a problem hiding this comment.
The idle loop clears ICR.IE before calling tx_low_power_enter(). Its TX_RESTORE restores that disabled posture, so TX_LOW_POWER_USER_ENTER runs with interrupts disabled. A callback waiting for the timer cannot receive its wake ISR. tx_low_power_exit() also runs immediately, before a wake interrupt is handled. Please allow wake interrupts during the user callback and handle exit on the wake path.
| set(CMAKE_C_FLAGS "-mcpu=tc38xx -std=c99 -fno-common -fstrict-volatile-bitfields -fdata-sections -ffunction-sections" CACHE INTERNAL "c compiler flags") | ||
| set(CMAKE_EXE_LINKER_FLAGS "-mcpu=tc38xx -Wl,--gc-sections" CACHE INTERNAL "exe link flags") | ||
| set(CMAKE_C_FLAGS_DEBUG "-O0 -g3" CACHE INTERNAL "c debug compiler flags") | ||
| set(CMAKE_C_FLAGS_RELEASE "-O0" CACHE INTERNAL "c release compiler flags") |
There was a problem hiding this comment.
Release, RelWithDebInfo, and MinSizeRel all use -O0, so production builds are unoptimized. Please set appropriate optimization flags and verify the context-switch tests with those settings.
Summary
This pull request adds a ThreadX port for the Infineon AURIX TC3xx family (TriCore TC1.6.2 core) with the AURIX GCC, an example for the AURIX TC375 Lite Kit, and a build that runs the ThreadX regression suite on that board.
Port
Thread contexts are kept in CSA chains. Threads enter the scheduler through a system call; interrupt handlers request a context switch through a GPSR software interrupt at the lowest priority. The port uses no driver library: it relies on the intrinsics and the start-up code (crt0-tc38xx.o) of the AURIX GCC. TX_PORT_USE_CCPN, TX_NOT_INTERRUPTABLE, TX_TIMER_PROCESS_IN_ISR, TX_EXECUTION_PROFILE_ENABLE and TX_LOW_POWER have port-specific code.
Change to shared test code
test/tx/regression/testcontrol.c takes the size and placement of its test memories from TEST_CONTROL_MEMORY_SIZE, TESTS_MEMORY_SIZE and TEST_MEMORY_PLACEMENT. The defaults keep the previous values, so other builds are unchanged. The TC375 needs smaller memories placed in DSPR1.
Verification
Hardware: AURIX TC375 Lite Kit (KIT_A2G_TC375_LITE) with AURIX GCC 03_2026 (GCC 11.3.1, Binutils 2.40.50).
The regression suite ran on the board in 13 configurations (the 7 of test/tx/cmake plus 6 for port options); each passed 97 tests with 0 failures and 0 system errors.
The example and the regression test build without warnings on Linux and Windows.
AI assistance
The development was assisted by Claude Code (Claude Opus 5.5). Files with AI-assisted changes carry the AI disclosure line. Code was reviewed and verified on the TC375 Lite Kit.
PR checklist